082 pi (proportional and integral) control system in liquid level 2
现在,我想在这里提到的非常重要的事情是我们的控制逻辑。
All right now very important thing which I would like to mention here this is our control logic.
我已经在上一个视频中将程序作为解释的一部分,但到目前为止,我们是用 C 语言编写代码,但在函数中。
I've already gotten the program as part of the explanation in my last video but so far we were we were writing the code in a C but in a function.
如果你看到这个程序块,如果我转到一个新块,我们正在函数中编写代码。
If you see this program block if I go to a new block we were writing the code in function.
好的,但是这次我们正在编写代码,我们正在功能块中编写代码。
Ok but this time we were writing the code we're writing the code in functional block.
现在 F.C. 和 F.C. 有什么区别?
Now what's the difference between F.C.
和f人。
and f people.
由于我们使用与 C 相同的内容,所以 c 和 if block is in 之间的主要区别是很大的。
Since we're using the same as C is the big the main difference between a c and if the block is in.
如果人们谈论我们有静态变量。
If people talk we have static variables.
如果您注意到这里我有一些静态变量静态变量意味着它存储值,除非您重置它们。
If you notice here I have some static variables static variable means which stores the value unless you reset them.
现在我们为什么需要这个。
Now why do we need that.
如果您从我们最后的解释中了解到,我们需要一个完整的 Santigold 输出输出,它存储每个周期的误差值。
If you understand from our last explanation we need an integral outport the Santigold output which has store the values of error at every cycle.
好的,所以我们需要一个变量来存储它将继续添加错误并且它将启动它,除非我们在正常函数中的函数中以其他方式重置。
OK so we need a variable which will store the which will keep on adding the errors and it will start it unless we reset otherwise in function in the normal function.
我们没有静态变量。
We don't have static variable.
这意味着价值将继续存在。
It means the value will keep on it.
但这里我们有一个静态变量。
But here we have a static variable.
所以我们需要一些我们不想重置的变量。
So we need some variables which we don't want to reset.
这就是我们采用功能块的原因。
That's why we took functional block.
因此,如果您在有 indigo 或任何其他编程的地方编写 B I 代码,那么您需要存储更多周期的值才能使用功能块。
So if you're writing the code of B I wherever you have indigo or any other programming then you need to store the value for more cycles to use function block.
所以这是第四个位置。
So this was the fourth spot.
好的。
All right.
现在这是我向你解释的部分,你需要一个愤怒的输出,它等于负输出加上错误。
Now this is the part where I explained to you you need an indignant output which is equal to negative output plus error.
所以这会继续将错误添加到每个周期中。
So this will keep on adding the error to every cycle.
现在,Mad 的手动模式和移动逻辑在我解释过的情况下会发生和管理,但它很高。
Right now Mad's manual mode and logic to the move bumps I explained do and manage but it is high.
现在这个按钮在哪里。
Now where is this button.
这个按钮位于我们的控制面板中。
This button is in our control panel.
它在这里。
It's here.
这是一辆汽车,这是一个人。
This is an auto and this is a man.
好的。
OK.
汽车和人。
Auto and man.
那么当手动按钮很高时我们想要什么。
So when manual button is high what do we want.
我们想要我们的灌装边灌装边灌装手册。
We want our filling the filling while filling manual.
这个灌装手册是什么灌装手册就在这里。
What is this filling manual filling manual is it here.
我有一面新的潜在镜子感觉着我的。
I have a new potential mirror feeling mine.
好的。
All right.
第二点和度数输出为零。
Second point and degree output is zero.
我已经解释过你要拆除炸弹了。
I have explained you to remove bombs.
您必须将度数输出设置为零。
You have to put in a degree output to zero.
这就是我们在这里所做的。
That's what we did here.
好的。
OK.
否则,如果没有手动,则意味着这里是自动模式 自动模式。
Otherwise as if manual is not on it means it means here it's the automatic mode automatic mode.
我们有同样的感觉,一切都是平等的,进入这个就是 K.P.
We're feeling the same feeling all is equal and to enter into the this is K.P.
积分增益分为误差加和数字。
into error plus and digital in integral gain.
这是进行数字输出时的积分增益。
This is an integral gain in doing digital output.
这是输出。
This is the output.
这就是我在这里解释的。
That's what I explained here.
保持误差比例增益并做得更好。
Keeping error proportional gain and do better.
我不认为输出。
I don't think that output.
所以这里只是可变键ISO积分增益的变化。
So here is just the change in variable key ISO integral gain.
这是误差中的窗口比例增益,并且再次进入其总和,但现在正在消耗输出,但我们知道这等于由于干扰而一直消耗输入以进行拆除。
This is the window proportional gain in error and again into summation of which is here present but right now draining output but we know that is equal to draining input to dismantle all the time because of a disturbance.
现在我解释了抗饱和逻辑,以防止饱和。
Now anti-wind up logic which I explained to prevent saturation.
这是我在这里解释的部分,以防止饱和,因为饱和度正在不断增加。
This is the part I explain here to prevent saturation because this is keep on increasing.
因此,如果输出值高于 10 点,那么我拥有它,并且它的填充值高于 10.0,并且数字输出等于旧积分。
So if the value of output is above 10 point oh so I have it and it is filling is here above 10.0 and digital output is equal to old integration.
这是我在这里解释的部分。
This is the part I explain here.
以及这一切都是什么。
And what is it all in.
好的。
OK.
现在这一切都结束了,这里还提到老 Indigo 正在获得数字输出的价值。
Now this all ended with is also mentioned here old Indigo is getting the value of a digital output.
我这里也给大家解释一下。
I also explain to you here.
对不起。
Sorry.
好的。
OK.
这是我之前解释过的文章的最后一部分。
So this comes at the last part of Article I explained it before.
所以这是我感觉输出等于 10 的最后一部分,因为我们只有在填满但超过 10 K 的情况下才必须保持 Stoughton 的值。
So this is the last part I'm feeling output is equal to 10 because we have to maintain the Stoughton's only in the case of filling up but is going beyond 10 K..
类似地,填充将小于 0.2,度输出等于度,填充等于零。
Similarly filling is going to less than 0.2 and degree output is equal to a degree and filling is equal to zero.
好的,我希望这个代码有意义,如果您需要学校的副本,我肯定会给您,以便您可以练习一下。
OK I hope this code makes sense and if you need a copy of the school I will give it to you for sure so that you can practice a little bit.
现在让我们下载这个逻辑并在我们的工厂下载中查看结果。
So let's download this logic now and see the result in our factory downloading.
现在我们有了整个机制。
And now we have this whole mechanism here.
我添加了分钟按钮和感觉方式。
I have added a minute button and feeling manner.
这些是相同的额外其余部分。
These are the extra rest of the same.
所以我们去给一些吧。
So let's go and give some.
好的。
All right.
所以我有一些关注 11 和 0.03 的值,这是通过手动完成的,因为我得到了 Jenning 的响应,我想看看系统如何响应并捍卫这些值。
So I have d'une some value of keeping an eye to 11 and 0.03 this is done by manually because I was getting Jenning the response I want to see how the system responds and defending the values.
所以我得出的值是 11 你的 K.P.
So I come up to a value which was 11 your K.P.
和0.03,你现在也可以做到。
and 0.03 and you can also do it now.
因此,让我们首先谈谈增益,我们可以说,这就是生活。
So let's talk about first the gain v the gain to let's say it's life.
现在,如果我不给我,这将充当美元的比例,因为我的为零。
Now here if I don't give I this will act as a proportion of the dollar because my is zero.
当你开始给予我的那一刻,这就成为你的控制权。
The moment you start giving I this becomes your control.
好的。
All right.
所以现在我们处于自动模式。
So right now we are at the auto mode.
排空人井不会造成任何干扰,我们可以给出一个设定点。
Draining manwell is nothing we can give some disturbance and we can give a set point.
所以现在如果艾弗森的排水和填充是由 EPA 控制来控制的话,训练经理是 3.5,所以你可以看到它正在被喂食,它正在减少,并且它正在超越现在。
So right now what training manager is 3.5 if Iverson draining and filling is controlled by EPA control so you can see that this is being fed it is being reduced and it is going beyond now.
所以这意味着我们已经质疑了我们只是随机给出值的山谷。
So which means we have impugned the valley we just give the value randomly.
那么让我们看看我们可以根据我们的控制操作来实现值的控制。
So let's see the control we can do the value based on our control action.
所以这能够控制我们可以看到系统如何响应的动作。
So this is able to control action we can see that how the system is responding.
现在我们知道我们来这里是为了减少偏移,而且我们也是为了减少这个上升的冲击。
Now we know that we are here to reduce the offset and also we're here to reduce this bump this ramp up.
好的。
Okay.
所以这个控制器是 Pond 的,你可以在这里看到,你也可以在这里看到,在我们最后一个例子中,误差几乎为零点零,比例控制器误差永远不会为零。
So this controller is Pond's you can see here and also you can see here the error is getting reduced to almost zero point zero in our last example proportional controller error never goes to zero.
如果它降到零,我们会非常高兴,但这是不必要的。
If it goes to zero we had a lot of us elation which is not required.
但这里没有振荡。
But here there is no oscillations.
好的。
OK.
因此,让我们增加设定值以查看更多响应。
So let's increase the setpoint see more response.
凯正在使用,但我们不想过度使用。
Kay is using but we don't want to overshoot.
但这里的错误将在这里超调。
But here the error is going to overshoot right here.
因此,如果您看到这部分,这将会超出范围,因为我们没有太多控制操作。
So if you see this part this is going to overshoot because we don't have much control action OK.
在这种情况下,我想增加增益以提供更多的比例,我现在是 11 K.P.
In this case I would like to increase the gain to give more proportionality too I'm at 11 now 11 K.P.
比格勒 0.02,现在是 0.07。
and Bigler 0.02 and right now the 0.07.
所以它在很大程度上属于这个范围。
So it is quite much into the range.
好的。
OK.
现在让我们看看我们要做的就是在增加训练的同时增加绿化。
Now let's see what we do is let's increase that greening the moment we increase that training.
您可以注意到填充已按比例增加。
You can notice that the filling has been increased proportionally.
因此,如果我们注意到这里,这将会跳回并降低稳态。
So if we notice here this is going to jump back and going to reduce the steady state.
而这整个阿什诺夫利用稳态误差是通过积分作用。
And this this whole Ashenoff that using the steady state error is by the integral action.
那么你只需在某种程度上增加结束生命的程度即可。
So then you just increase ending life in a bit more in degree.
行动是非常敏感的,所以你必须确保你不应该将其增加到超过一定限度。
Action is very sensitive so you have to make sure you should not increase it beyond certain limit.
我想保持0.03。
I would like to keep it that 0.03.
仅仅因为我的错误没有完美调整,我想增加更多。
And just because my error is not perfectly tuned I would like to increase it more.
你做什么有价值的事情。
What do you make anything of value.
好的。
All right.
让我们使用此时的设定点。
Let's use the set point at this point.
我们需要翻阅《便5:6》。
We need to reach out to Ben 5:6.
所以我的感觉完全为零。
So my feeling is completely zero.
这是使用编辑器的注释来读取的,您可以注意到,即使在编辑变为零之前,它也开始填充,因为积分操作知道过去并且它的 POS 已经在使用。
And this is read using an editor's note using and you can notice that even before the edit goes to zero it starts filling because integral action knows the past and the POS at it is already using.
这就是控制器操作减少的原因。
That's why a controller action is reducing.
所以你甚至注意到这里。
So you even notice here.
这可以防止在负阶段负边缘发生过冲(您不知道负值),并且负循环永远不会低于设定点。
This prevents over overshoot at the negative stage negative edge you know not negative and the negative cycle it never goes below the set point.
这就是您查看控制器的方式。
That's how you view the controller.
现在让我们再次返回,它在设定点增加。
Now let's go back again and it's increased at set point.
现在四点七七四十七点七分的秘密。
Now four point seven seven forty seven point seven percent of the secret.
现在你必须确定一下。
Now here you have to make sure.
如果没有,则不应跳过设定点。
It should not jump the setpoint if it does not.
这意味着控制器已正确调整。
It means the controller is properly tuned.
应该失踪了。
Should be missing.
你可以看到它就在这里。
You can see that here it is.
现在,如果您可能想知道为什么要花很多时间才能到达这里,因为我们可以做任何事情,因为这是系统的滞后。
Now if you might be wondering why it's taking a lot of time to reach here because we can do anything because this is the lag in the system.
这是 100% 的状态,要填满水箱需要时间。
This is this was 100 percent on and to fill the tank it takes time.
所以你可以对这部分做任何事情。
So you can do anything about this part.
你不可能有这样的曲线,你从这里知道曲线。
You can't have a curve like this you know curve like from here.
你可以做到,但在这个系统中这是不可能的。
You can do it but that's not possible in this system.
所以你可以看到这部分的值并没有像这里那样跳跃。
So you can see there at this part the value did not jump like here.
所以我们在这里所做的只是增加了比例增益,这也稳定了您的系统。
So what we did here we just increased the proportion gain which also stabilize your system.
好的。
All right.
所以我们的响应曲线完全正常。
So here our response curve is coming perfectly OK.
您可以尝试更多的操作。
You can try some more action.
好的。
All right.
现在我谈到手动控制。
Now I talked about manual control.
好的。
OK.
因此,在手动控制中,我所做的就是切换到手动模式。
So in manual control what I do is either switch to manual mode.
好的。
OK.
这是我在手动模式下的手动模式,但我们的训练是 85% 的电池。
This is my manual mode in manual mode but we have training is 85 percent cell.
取决于我。
It's up to me.
你知道我有多想和这三个人一起开场。
You know how much I want to open with these three.
所以这不再是我的男人了。
So this is my man no more.
现在假设我想回到自动模式,您所要做的就是停止 Neumont,现在它将遵循设定点并开始填充。
Now suppose I wanted to go back to auto mode all you have to do is just stop the Neumont and now it will follow the setpoint and it will start filling up.
但这就是您在手动和自动之间切换的方式。
But this is how you switch between manual and auto.
转到手动,如果您在手动培训手动工作中转到自动并且您的输入将被设置,则这些控制器将工作。
Go to manual these controllers will work if you go to auto on the manual training manual work and your input will be set.
好的。
OK.
如果你有这个工厂,我强烈建议你建立这个逻辑链接,你是 TIAA 并称为逻辑。
If you have this factory I'll highly suggest you to make this logic linkage that you are TIAA and called the logical.
你可以遵循逻辑。
And you can to the logic.
所以在这就是这样了。
So in this this is it.
好的。
OK.
所以在这里你又会归零,你也可以一次又一次地玩弄手杖和比例,以了解如果你改变游戏,你将得到的差异响应曲线。
So here again you are is going to zero and you can also play around with the cane and the proportion again and again to understand the difference response curve you will get if you change the game.
如果将其移动到超过 15 临界值,即使增加程度增益,您也会出现振荡。
If you move it beyond 15 are critical value you can have the oscillations even if increase in degree gain you would have in oscillations.
因此,您可以根据系统中实际需要的内容来调整周界。
So you can tune the perimeter based on what you actually want in your system.
好的。
All right.
好吧,你可以看到我正在回到零。
Well you can see that I was going back to zero.
因此,如果您对此视频有任何疑问,可以回复我。
So if you have any doubt in this video you can get back to me.
并且有一些高度高度敏感的系统,其中误差变化率太大。
And there are some high highly highly sensitive system in which you have a rate of change of error is too much.
在这种情况下,在参数中使用像 Zegerid Nicola 这样的方法,但我没有使用任何特定的调整方法,我只是使用命中和试验来使用它,其中首先我们增加比例增益,然后我们再次缓慢地增加积分,一直持续到我们得到分数为止。
In that case with in the parameters using some method like Zegerid Nicola's but I'm not using any specific tuning method I'm just using it using hit and trial in which first we increase the proportional gain and then we increase the integral again slowly and steadily until we get the scores.
这也是调整控制器的另一种方法。
This is also another way to tune the controller.
正确的。
Right.
因此,如果您有任何疑问,可以回复我,我们可以通过说您知道我们在积分控制方面有一些优势来总结本次讲座。
So if you have any doubt you can get back to me and we can sum up this lecture by saying that you know we have some advantage off into go integral control with.
它确实使用了偏移量,但缺点是很难调整,因为现在我们有两件事要做。
It did use offset and a disadvantage is it's difficult to tune because now we have two things to do.
一是比例增益,一是愤慨。
One is a proportional gain and one is indignant.
它有点不稳定,因为它不稳定是因为我们对你的愤怒行动和控制产生了很大的影响。
And it is slightly unstable because it's unstable because we have a big effect of your indignant action of this indignant action and and control.
那么有时它会变得不稳定。
Well then sometimes it becomes unstable.
正确的。
Right.
因此,我将在此处将我的控制曲线作为该曲线的基础,您可以提交到您的演示文稿。
So I'm going to base the curve of my control this curve here and you can submit to your presentation.
感谢您的观看,我们将在下一个视频中见到您。
So thank you for watching and I'll see you in the next video.